<template>
  <a-modal title="学部会表决结果录入" :visible="visible" @ok="handleSave" @cancel="handleClose" width="950px">
    <a-form :form="form">
      <a-row :gutter="48">
        <a-col :sm="{span:6}" :lg="{span:6}" :xl="{span:6}">
          <a-form-item label="学号">
            <a-input disabled v-model="data.xh" />
          </a-form-item>
        </a-col>
        <a-col :sm="{span:6}" :lg="{span:6}" :xl="{span:6}">
          <a-form-item label="姓名">
            <a-input disabled v-model="data.xm" />
          </a-form-item>
        </a-col>
        <a-col :sm="{span:6}" :lg="{span:6}" :xl="{span:6}">
          <a-form-item label="院系">
            <a-input disabled v-model="data.ssyxmc" />
          </a-form-item>
        </a-col>
        <a-col :sm="{span:6}" :lg="{span:6}" :xl="{span:6}">
          <a-form-item label="专业">
            <a-input disabled v-model="data.sszymc" />
          </a-form-item>
        </a-col>
        <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:8}">
          <a-form-item label="学科门类">
            <a-input disabled v-model="data.xkmlmc" />
          </a-form-item>
        </a-col>
        <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:8}">
          <a-form-item label="学生类别">
            <a-input disabled v-model="data.xslbmc" />
          </a-form-item>
        </a-col>
        <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:8}">
          <a-form-item label="导师姓名">
            <a-input disabled v-model="data.dsxm" />
          </a-form-item>
        </a-col>
        <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:8}">
          <a-form-item label="委员总数">
            <a-input-number :min="0" v-decorator="[
                'wyzs',
                {
                  rules: [{ required: true, message: '请输入委员总数!' }]
                }
              ]" style="width: 100%" />
          </a-form-item>
        </a-col>
        <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:8}">
          <a-form-item label="同意票数">
            <a-input-number :min="0" v-decorator="[
                'typs',
                {
                  rules: [{ required: true, message: '请输入同意票数!' }]
                }
              ]" style="width: 100%" />
          </a-form-item>
        </a-col>
        <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:8}">
          <a-form-item label="到会人数">
            <a-input-number :min="0" v-decorator="[
                'dhrs',
                {
                  rules: [{ required: true, message: '请输入到会人数!' }]
                }
              ]" style="width: 100%" />
          </a-form-item>
        </a-col>
        <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:8}">
          <a-form-item label="反对票数">
            <a-input-number :min="0" v-decorator="[
                'fdps',
                {
                  rules: [{ required: true, message: '请输入反对票数!' }]
                }
              ]" style="width: 100%" />
          </a-form-item>
        </a-col>
        <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:8}">
          <a-form-item label="审核结果">
            <a-select v-decorator="[
                'shjg',
                {
                  rules: [{ required: true, message: '请选择审核结果!' }]
                }
              ]" :allowClear="true" showSearch optionFilterProp="children" >
              <a-select-option v-for="i in TYPE0374" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :sm="{span:8}" :lg="{span:12}" :xl="{span:8}">
          <a-form-item label="弃权票数">
            <a-input-number :min="0" v-decorator="[
                'qqps',
                {
                  rules: [{ required: true, message: '请输入弃权票数!' }]
                }
              ]" style="width: 100%" />
          </a-form-item>
        </a-col>
      </a-row>
      <a-alert message="说明：1、委员总数=同意票数时，为全票通过，学部会、校委会默认审核通过。（审核结果必须为通过）2、到会人数＝同意票数+反对票数+弃权票数" type="error" />
    </a-form>
  </a-modal>
</template>
<script>
import { mapState } from 'vuex'
export default {
  props: {
    visible: {
      default: false
    },
    data: {
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
      form : this.$form.createForm(this),
      queryParam: {},
      TYPE0126: [],
      selectMenu: {
        yx: []
      }
    }
  },
  computed: {
    ...mapState({
      TYPE0374: state => state.app['TYPE0374'] // 审核结果
    })
  },
  created() {},
  methods: {
    handleSave() {
      this.form.validateFields(
        (err,values) => {
          if (!err) {
            this.$emit('success',values)
          }
        },
      );
    },
    handleClose() {
      this.$emit('close')
    }
  }
}

</script>
